package com.wv.model.basic;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = false)
@TableName("basic_area_code")
public class BasicAreaCode {

    @TableId(value = "id", type = IdType.INPUT)
    private String id; // 主键

    private String code; // 地区编码

    private String name; // 地区名称

    private Short level; // 地区级别

    private String parentCode; // 父级区域编码

    private String firstLetter; // 名称首字母

    @TableField(exist = false)
    private List<BasicAreaCode> children; // 子级区域

    public BasicAreaCode setChildren(List<BasicAreaCode> children) {
        this.children = children;
        return this;
    }
}
